package com.leyikao.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.leyikao.service.TempletService;


/**
 * 网站入口<br>
 *
 * @author LoadChange
 *
 */
@Controller
@RequestMapping("/")
public class WelcomeCtrl {
	private static final Logger logger = LoggerFactory.getLogger(WelcomeCtrl.class);
	
	@Resource
	private TempletService tempService;
	
	/**
	 * 首页
	 * 
	 * @param request
	 * @return
	 */
	@RequestMapping("/")
	public String index(HttpServletRequest request,Model model) {
		model.addAttribute("webtitle", "个人中心 - 乐易考")// 网站标题
		.addAttribute("mtemplet", tempService.getWriteAll())
		.addAttribute("templet", tempService.getReadAll());//学校列表
		return "welcome/index";
	}

	
}
